<!doctype html>
<html lang="en">
  <head>
    <title>drive-internals</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
    <link rel="stylesheet" href="drive_internals.css">
    <script src="chrome://resources/js/assert.js"></script>
    <script src="chrome://resources/js/util.js"></script>
    <script src="chrome://drive-internals/drive_internals.js"></script>
  </head>
  <body>
    <h1>Drive Internals</h1>
    <ul id="toc"></ul>

    <section id="connection-status-section" hidden>
      <h2>Connection Status</h2>
      <ul>
        <li>
          Status: <span id="connection-status"></span>
        </li>
        <li>Push notifications enabled:
          <span id="push-notification-enabled"></span>
        </li>
      </ul>
    </section>

    <section id="drive-debug" hidden>
      <h2>Drive Debug</h2>
      <div>
        <label>
          Verbose logging
          <input type="checkbox" id="verbose-logging-toggle">
        </label>
      </div>
      <div>
        Tracing
        <button id="button-enable-tracing">Enable</button>
        <button id="button-disable-tracing">Disable</button>
      </div>
      <div id="developer-mode-controls" hidden>
        <div>
          <div>Startup Arguments</div>
          <form id="startup-arguments-form">
            <input id="startup-arguments-input">
            <button type="submit">Apply</button>
            <span id="arguments-status-text"></span>
          </form>

          <div>Networking</div>
          <div>
            <button id="button-enable-networking">Enable</button>
            <button id="button-disable-networking">Disable</button>
          </div>

          <div>Force pause syncing</div>
          <div>
            <button id="button-enable-force-pause-syncing">Enable</button>
            <button id="button-disable-force-pause-syncing">Disable</button>
          </div>

          <div>Account settings</div>
          <div>
            <button id="button-dump-account-settings">Dump</button>
            <button id="button-load-account-settings">Load</button>
          </div>
        </div>
      </div>
      <div>
        <button id="button-restart-drive">Restart Drive</button>
        <button id="button-reset-drive-filesystem">
          Clear local data
        </button>
        <span id="reset-status-text"></span>
      </div>
      <ul>
        <li>Local Free Space:
          <span id="local-storage-freespace"></span> MB
        </li>
      </ul>
    </section>

    <section id="account-information-section" hidden>
      <h2>Account Information</h2>
      <ul>
        <li>Remote Changestamp:
          <span id="account-largest-changestamp-remote"></span>
        </li>
        <li>Quota Information: <span id="account-quota-info"></span></li>
        <li>Root Resource Id: <span id="root-resource-id"></span></li>
      </ul>
    </section>

    <section id="delta-update-status-section" hidden>
      <h2>Delta Update Status</h2>
      <table>
        <tbody id="delta-update-status">
          <tr>
            <th>Source</th>
            <th>Virtual Path</th>
            <th>Start Page Token</th>
            <th>Last Update Check Time</th>
            <th>Last Update Check Result</th>
            <th>Refreshing</th>
          </tr>
        </tbody>
      </table>
    </section>

    <section id="in-flight-operations-section" hidden>
      <h2>In-flight Operations</h2>
      <table>
        <tbody id="in-flight-operations-contents">
          <tr>
            <th>ID</th>
            <th>Type</th>
            <th>File Path</th>
            <th>State</th>
            <th>Progress</th>
          </tr>
        </tbody>
      </table>
    </section>

    <section id="path-configurations-section" hidden>
      <h2>Path Configurations</h2>
      <ul id="path-configurations">
      </ul>
    </section>

    <section id="drive-related-preferences-section" hidden>
      <h2>Drive related Preferences</h2>
      <ul id="drive-related-preferences">
      </ul>
    </section>

    <section id="event-log-section" hidden>
      <h2>Event Log</h2>
      <ul id="event-log">
      </ul>
    </section>

    <section id="service-log-section" hidden>
      <h2>Service Log</h2>
      <button id="button-export-logs">Export logs</button>
      <ul>
        <li><a id="other-logs">Other Logs</a>
      </ul>
      <ul id="service-log">
      </ul>
    </section>

    <section id="cache-contents-section" hidden>
      <h2>Cache Contents</h2>
      <table>
        <tbody id="cache-contents">
          <tr>
            <th>Local ID</th>
            <th>MD5</th>
            <th>Present</th>
            <th>Pinned</th>
            <th>Dirty</th>
          </tr>
        </tbody>
      </table>
    </section>

    <section id="gcache-contents-section" hidden>
      <details>
        <summary><h2>GCache Contents</h2></summary>
        <table>
          <tbody id="gcache-contents">
            <tr>
              <th>Path</th>
              <th>Size</th>
              <th>Last Modified</th>
              <th>Permission</th>
            </tr>
          </tbody>
        </table>
      </details>
      <ul>
        <li>
          Total Size:
          <span id="gcache-summary-total-size">(calculating...)</span> MB.
        </li>
      </ul>
    </section>
  </body>
</html>
